package cn.xinfei.xdecision.common.service.component.scorecard;

import cn.xinfei.xdecision.common.model.common.PageResult;
import cn.xinfei.xdecision.common.model.common.ResponseEntityDto;
import cn.xinfei.xdecision.common.model.common.requestParam.AssemblyRuleCodeReq;
import cn.xinfei.xdecision.common.model.common.requestParam.StatusParam;
import cn.xinfei.xdecision.common.model.component.decisiontree.vo.DecisionTreeVersionVo;
import cn.xinfei.xdecision.common.model.component.scorecard.ScorecardVersion;
import cn.xinfei.xdecision.common.model.component.scorecard.vo.ScorecardVersionListVo;
import cn.xinfei.xdecision.common.model.component.scorecard.vo.ScorecardVersionVo;
import cn.xinfei.xdecision.common.utils.enums.enginex.ComponentVersionStatusEnum;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * 评分卡(Scorecard) Service接口
 */
public interface ScorecardVersionService extends IService<ScorecardVersion> {

    /**
     * 通过决策树code集合，查询版本集合
     *
     * @param scorecardCode 评分卡code
     * @param status        版本状态
     * @return {@link ScorecardVersionVo 评分卡版本}
     * @see ComponentVersionStatusEnum
     */
    List<ScorecardVersionVo> queryVersionByScorecardCodes(List<String> scorecardCode, Integer status);

    List<ScorecardVersionVo> queryVersionListByScorecardId(String scorecardCode);
    List<ScorecardVersionVo> queryVersionListByScorecardId(String scorecardCode,Long versionNo);

    List<String> queryFieldEnByVersionId(Long versionId);

    void addVersionList(List<ScorecardVersionVo> versionList);

    boolean addVersion(ScorecardVersionVo version);

    boolean copyVersion(ScorecardVersionVo version);

    boolean updateVersion(ScorecardVersionVo version);

    boolean updateStatus(StatusParam statusParam);

    // runner
    ScorecardVersionVo queryById(Long id);

    Boolean saveOrUpdateVersion(ScorecardVersionVo scorecardVersionVo);

    Long checkAndAddVersion(ScorecardVersionVo version);

    void lockScorecard(Long versionId);

    ResponseEntityDto<PageResult<List<ScorecardVersionListVo>, ScorecardVersion>> listByScorecardCode(AssemblyRuleCodeReq req);
}
